home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2002 November / SGI Freeware 2002 November - Disc 1.iso / dist / fw_apache2.idb / usr / freeware / apache2 / conf / ssl.conf.z / ssl.conf
Text File  |  2002-07-08  |  12KB  |  265 lines

  1. #
  2. # This is the Apache server configuration file providing SSL support.
  3. # It contains the configuration directives to instruct the server how to
  4. # serve pages over an https connection. For detailing information about these 
  5. # directives see <URL:http://httpd.apache.org/docs-2.0/mod/mod_ssl.html>
  6. #
  7. #   For the moment, see <URL:http://www.modssl.org/docs/> for this info. 
  8. #   The documents are still being prepared from material donated by the
  9. #   modssl project.
  10. # Do NOT simply read the instructions in here without understanding
  11. # what they do.  They're here only as hints or reminders.  If you are unsure
  12. # consult the online docs. You have been warned.  
  13. #
  14. <IfDefine SSL>
  15.  
  16. #   Until documentation is completed, please check http://www.modssl.org/
  17. #   for additional config examples and module docmentation.  Directives
  18. #   and features of mod_ssl are largely unchanged from the mod_ssl project
  19. #   for Apache 1.3.
  20.  
  21. #
  22. # When we also provide SSL we have to listen to the 
  23. # standard HTTP port (see above) and to the HTTPS port
  24. #
  25. Listen 443
  26.  
  27. #
  28. # Dynamic Shared Object (DSO) Support
  29. #
  30. # To be able to use the functionality of a module which was built as a DSO you
  31. #    ErrorLog logs/dummy-host.example.com-error_log
  32. #    CustomLog logs/dummy-host.example.com-access_log common
  33.  
  34. ##
  35. ##  SSL Global Context
  36. ##
  37. ##  All SSL configuration in this context applies both to
  38. ##  the main server and all SSL-enabled virtual hosts.
  39. ##
  40.  
  41. #
  42. #   Some MIME-types for downloading Certificates and CRLs
  43. #
  44. AddType application/x-x509-ca-cert .crt
  45. AddType application/x-pkcs7-crl    .crl
  46.  
  47. #   Pass Phrase Dialog:
  48. #   Configure the pass phrase gathering process.
  49. #   The filtering dialog program (`builtin' is a internal
  50. #   terminal dialog) has to provide the pass phrase on stdout.
  51. SSLPassPhraseDialog  builtin
  52.  
  53. #   Inter-Process Session Cache:
  54. #   Configure the SSL Session Cache: First the mechanism 
  55. #   to use and second the expiring timeout (in seconds).
  56. #SSLSessionCache        none
  57. #SSLSessionCache        shmht:logs/ssl_scache(512000)
  58. #SSLSessionCache        shmcb:logs/ssl_scache(512000)
  59. SSLSessionCache         dbm:logs/ssl_scache
  60. SSLSessionCacheTimeout  300
  61.  
  62. #   Semaphore:
  63. #   Configure the path to the mutual exclusion semaphore the
  64. #   SSL engine uses internally for inter-process synchronization. 
  65. SSLMutex  file:logs/ssl_mutex
  66.  
  67. #   Pseudo Random Number Generator (PRNG):
  68. #   Configure one or more sources to seed the PRNG of the 
  69. #   SSL library. The seed data should be of good random quality.
  70. #   WARNING! On some platforms /dev/random blocks if not enough entropy
  71. #   is available. This means you then cannot use the /dev/random device
  72. #   because it would lead to very long connection times (as long as
  73. #   it requires to make more entropy available). But usually those
  74. #   platforms additionally provide a /dev/urandom device which doesn't
  75. #   block. So, if available, use this one instead. Read the mod_ssl User
  76. #   Manual for more details.
  77. SSLRandomSeed startup builtin
  78. SSLRandomSeed connect builtin
  79. #SSLRandomSeed startup file:/dev/random  512
  80. #SSLRandomSeed startup file:/dev/urandom 512
  81. #SSLRandomSeed connect file:/dev/random  512
  82. #SSLRandomSeed connect file:/dev/urandom 512
  83.  
  84. #   Logging:
  85. #   The home of the dedicated SSL protocol logfile. Errors are
  86. #   additionally duplicated in the general error log file.  Put
  87. #   this somewhere where it cannot be used for symlink attacks on
  88. #   a real server (i.e. somewhere where only root can write).
  89. #   Log levels are (ascending order: higher ones include lower ones):
  90. #   none, error, warn, info, trace, debug.
  91. SSLLog      logs/ssl_engine_log
  92. SSLLogLevel info
  93.  
  94. ##
  95. ## SSL Virtual Host Context
  96. ##
  97.  
  98. <VirtualHost _default_:443>
  99.  
  100. #  General setup for the virtual host
  101. DocumentRoot "/usr/freeware/apache2/htdocs"
  102. ServerName new.host.name:443
  103. ServerAdmin you@your.address
  104. ErrorLog logs/error_log
  105. TransferLog logs/access_log
  106.  
  107. #   SSL Engine Switch:
  108. #   Enable/Disable SSL for this virtual host.
  109. SSLEngine on
  110.  
  111. #   SSL Cipher Suite:
  112. #   List the ciphers that the client is permitted to negotiate.
  113. #   See the mod_ssl documentation for a complete list.
  114. SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL
  115.  
  116. #   Server Certificate:
  117. #   Point SSLCertificateFile at a PEM encoded certificate.  If
  118. #   the certificate is encrypted, then you will be prompted for a
  119. #   pass phrase.  Note that a kill -HUP will prompt again. A test
  120. #   certificate can be generated with `make certificate' under
  121. #   built time. Keep in mind that if you've both a RSA and a DSA
  122. #   certificate you can configure both in parallel (to also allow
  123. #   the use of DSA ciphers, etc.)
  124. SSLCertificateFile /usr/freeware/apache2/conf/ssl.crt/server.crt
  125. #SSLCertificateFile /usr/freeware/apache2/conf/ssl.crt/server-dsa.crt
  126.  
  127. #   Server Private Key:
  128. #   If the key is not combined with the certificate, use this
  129. #   directive to point at the key file.  Keep in mind that if
  130. #   you've both a RSA and a DSA private key you can configure
  131. #   both in parallel (to also allow the use of DSA ciphers, etc.)
  132. SSLCertificateKeyFile /usr/freeware/apache2/conf/ssl.key/server.key
  133. #SSLCertificateKeyFile /usr/freeware/apache2/conf/ssl.key/server-dsa.key
  134.  
  135. #   Server Certificate Chain:
  136. #   Point SSLCertificateChainFile at a file containing the
  137. #   concatenation of PEM encoded CA certificates which form the
  138. #   certificate chain for the server certificate. Alternatively
  139. #   the referenced file can be the same as SSLCertificateFile
  140. #   when the CA certificates are directly appended to the server
  141. #   certificate for convinience.
  142. #SSLCertificateChainFile /usr/freeware/apache2/conf/ssl.crt/ca.crt
  143.  
  144. #   Certificate Authority (CA):
  145. #   Set the CA certificate verification path where to find CA
  146. #   certificates for client authentication or alternatively one
  147. #   huge file containing all of them (file must be PEM encoded)
  148. #   Note: Inside SSLCACertificatePath you need hash symlinks
  149. #         to point to the certificate files. Use the provided
  150. #         Makefile to update the hash symlinks after changes.
  151. #SSLCACertificatePath /usr/freeware/apache2/conf/ssl.crt
  152. #SSLCACertificateFile /usr/freeware/apache2/conf/ssl.crt/ca-bundle.crt
  153.  
  154. #   Certificate Revocation Lists (CRL):
  155. #   Set the CA revocation path where to find CA CRLs for client
  156. #   authentication or alternatively one huge file containing all
  157. #   of them (file must be PEM encoded)
  158. #   Note: Inside SSLCARevocationPath you need hash symlinks
  159. #         to point to the certificate files. Use the provided
  160. #         Makefile to update the hash symlinks after changes.
  161. #SSLCARevocationPath /usr/freeware/apache2/conf/ssl.crl
  162. #SSLCARevocationFile /usr/freeware/apache2/conf/ssl.crl/ca-bundle.crl
  163.  
  164. #   Client Authentication (Type):
  165. #   Client certificate verification type and depth.  Types are
  166. #   none, optional, require and optional_no_ca.  Depth is a
  167. #   number which specifies how deeply to verify the certificate
  168. #   issuer chain before deciding the certificate is not valid.
  169. #SSLVerifyClient require
  170. #SSLVerifyDepth  10
  171.  
  172. #   Access Control:
  173. #   With SSLRequire you can do per-directory access control based
  174. #   on arbitrary complex boolean expressions containing server
  175. #   variable checks and other lookup directives.  The syntax is a
  176. #   mixture between C and Perl.  See the mod_ssl documentation
  177. #   for more details.
  178. #<Location />
  179. #SSLRequire (    %{SSL_CIPHER} !~ m/^(EXP|NULL)/ \
  180. #            and %{SSL_CLIENT_S_DN_O} eq "Snake Oil, Ltd." \
  181. #            and %{SSL_CLIENT_S_DN_OU} in {"Staff", "CA", "Dev"} \
  182. #            and %{TIME_WDAY} >= 1 and %{TIME_WDAY} <= 5 \
  183. #            and %{TIME_HOUR} >= 8 and %{TIME_HOUR} <= 20       ) \
  184. #           or %{REMOTE_ADDR} =~ m/^192\.76\.162\.[0-9]+$/
  185. #</Location>
  186.  
  187. #   SSL Engine Options:
  188. #   Set various options for the SSL engine.
  189. #   o FakeBasicAuth:
  190. #     Translate the client X.509 into a Basic Authorisation.  This means that
  191. #     the standard Auth/DBMAuth methods can be used for access control.  The
  192. #     user name is the `one line' version of the client's X.509 certificate.
  193. #     Note that no password is obtained from the user. Every entry in the user
  194. #     file needs this password: `xxj31ZMTZzkVA'.
  195. #   o ExportCertData:
  196. #     This exports two additional environment variables: SSL_CLIENT_CERT and
  197. #     SSL_SERVER_CERT. These contain the PEM-encoded certificates of the
  198. #     server (always existing) and the client (only existing when client
  199. #     authentication is used). This can be used to import the certificates
  200. #     into CGI scripts.
  201. #   o StdEnvVars:
  202. #     This exports the standard SSL/TLS related `SSL_*' environment variables.
  203. #     Per default this exportation is switched off for performance reasons,
  204. #     because the extraction step is an expensive operation and is usually
  205. #     useless for serving static content. So one usually enables the
  206. #     exportation for CGI and SSI requests only.
  207. #   o CompatEnvVars:
  208. #     This exports obsolete environment variables for backward compatibility
  209. #     to Apache-SSL 1.x, mod_ssl 2.0.x, Sioux 1.0 and Stronghold 2.x. Use this
  210. #     to provide compatibility to existing CGI scripts.
  211. #   o StrictRequire:
  212. #     This denies access when "SSLRequireSSL" or "SSLRequire" applied even
  213. #     under a "Satisfy any" situation, i.e. when it applies access is denied
  214. #     and no other module can change it.
  215. #   o OptRenegotiate:
  216. #     This enables optimized SSL connection renegotiation handling when SSL
  217. #     directives are used in per-directory context. 
  218. #SSLOptions +FakeBasicAuth +ExportCertData +CompatEnvVars +StrictRequire
  219. <Files ~ "\.(cgi|shtml|phtml|php3?)$">
  220.     SSLOptions +StdEnvVars
  221. </Files>
  222. <Directory "/usr/freeware/apache2/cgi-bin">
  223.     SSLOptions +StdEnvVars
  224. </Directory>
  225.  
  226. #   SSL Protocol Adjustments:
  227. #   The safe and default but still SSL/TLS standard compliant shutdown
  228. #   approach is that mod_ssl sends the close notify alert but doesn't wait for
  229. #   the close notify alert from client. When you need a different shutdown
  230. #   approach you can use one of the following variables:
  231. #   o ssl-unclean-shutdown:
  232. #     This forces an unclean shutdown when the connection is closed, i.e. no
  233. #     SSL close notify alert is send or allowed to received.  This violates
  234. #     the SSL/TLS standard but is needed for some brain-dead browsers. Use
  235. #     this when you receive I/O errors because of the standard approach where
  236. #     mod_ssl sends the close notify alert.
  237. #   o ssl-accurate-shutdown:
  238. #     This forces an accurate shutdown when the connection is closed, i.e. a
  239. #     SSL close notify alert is send and mod_ssl waits for the close notify
  240. #     alert of the client. This is 100% SSL/TLS standard compliant, but in
  241. #     practice often causes hanging connections with brain-dead browsers. Use
  242. #     this only for browsers where you know that their SSL implementation
  243. #     works correctly. 
  244. #   Notice: Most problems of broken clients are also related to the HTTP
  245. #   keep-alive facility, so you usually additionally want to disable
  246. #   keep-alive for those clients, too. Use variable "nokeepalive" for this.
  247. #   Similarly, one has to force some clients to use HTTP/1.0 to workaround
  248. #   their broken HTTP/1.1 implementation. Use variables "downgrade-1.0" and
  249. #   "force-response-1.0" for this.
  250. SetEnvIf User-Agent ".*MSIE.*" \
  251.          nokeepalive ssl-unclean-shutdown \
  252.          downgrade-1.0 force-response-1.0
  253.  
  254. #   Per-Server Logging:
  255. #   The home of a custom SSL log file. Use this when you want a
  256. #   compact non-error SSL logfile on a virtual host basis.
  257. CustomLog logs/ssl_request_log \
  258.           "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  259.  
  260. </VirtualHost>                                  
  261.  
  262. </IfDefine>
  263.  
  264.